package cn.whpu.omnitrixerp.controller.basicdata;


import cn.whpu.omnitrixerp.common.Result;
import cn.whpu.omnitrixerp.entity.po.basicdata.DepartmentPO;
import cn.whpu.omnitrixerp.service.basicdata.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Gim Gong
 * @date 2025/6/14
 */
@RestController
@RequestMapping("/department")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @PostMapping("/list")
    public Result<List<DepartmentPO>> getList() {
        List<DepartmentPO> list = departmentService.list();
        return Result.success(list);
    }

}
